package com.sloth.rabbitmq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MQSender {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendSeckillMessage(String message){
        System.out.println("发送信息"+message);
        rabbitTemplate.convertAndSend("seckillExchange","seckill.message",message);
    }
}
